package top.cardone.api.vx.authority.rolePermission

import org.apache.shiro.SecurityUtils

class index implements java.io.Serializable {
    def input(input) {
        input
    }

    def validation(input) {

    }

    def func(input) {
        input
    }

    def output(output) {
        output.permission_add = SecurityUtils.getSubject().hasRole('administrator') || SecurityUtils.getSubject().isPermitted('authority:rolePermission:add')
        output.permission_modify = SecurityUtils.getSubject().hasRole('administrator') || SecurityUtils.getSubject().isPermitted('authority:rolePermission:modify')
        output.permission_delete = SecurityUtils.getSubject().hasRole('administrator') || SecurityUtils.getSubject().isPermitted('authority:rolePermission:delete')
        output.permission_import = SecurityUtils.getSubject().hasRole('administrator') || SecurityUtils.getSubject().isPermitted('authority:rolePermission:import')
        output.permission_export = SecurityUtils.getSubject().hasRole('administrator') || SecurityUtils.getSubject().isPermitted('authority:rolePermission:export')

        output
    }
}